POV-Ray : Newsgroups : povray.binaries.images : Copying pigments with crackle (124k jpg) : Re: Copying pigments with crackle (124k jpg) Server Time
1 Aug 2024 12:26:01 EDT (-0400)
  Re: Copying pigments with crackle (124k jpg)  
From: stbenge
Date: 29 Jul 2008 18:36:13
Message: <488f9b5d@news.povray.org>
Tek wrote:
> Awesome! I wanted something like that ages ago when I did my procedural 
> crackle based city. I couldn't figure out how to do it. Now I'm just trying 
> to understand your code!

It pays off to keep trying. I can't tell you how many times I've tried 
to get this to work.

> Is there any way to make it work with metric 1?

Yes, you can get some interesting effects. Here, try this out:

#macro pcc(pgmt, Mod)
  #local pgmt2 =
   function{
    pattern{
     pigment_pattern {pgmt}
    }
   }
  #local pg1=
   function{
    pattern{
     crackle form x*.75
     metric 1
    }
   }
  function{
   pgmt2(
    (pow(pg1(x+Mod,y,z),2)-pow(pg1(x-Mod,y,z),2))/(Mod*1.2),
    (pow(pg1(x,y+Mod,z),2)-pow(pg1(x,y-Mod,z),2))/(Mod*1.2),
    (pow(pg1(x,y,z+Mod),2)-pow(pg1(x,y,z-Mod),2))/(Mod*1.2)
   )
  }
#end

plane{z,0
  pigment{
   pcc(
    pigment{
     radial rotate x*90+z*45
     triangle_wave frequency 2
     color_map{[0 rgb 0][1 rgb 1]}
    }
    ,.05
   )
  }
}

It makes rectangular masses all over the place. Nest a few of those with 
different translation values, and a cityscape might be possible.

Sam


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.